package com.link.ppt.View;

import android.content.Intent;

import com.link.ppt.App.App;
import com.link.ppt.Base.BaseActivity;
import com.link.ppt.R;

import java.util.concurrent.TimeUnit;

import rx.Observable;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action1;

/**
 * 欢迎画面
 * Created by liucxu on 2018/1/23.
 */

public class SplashActivity extends BaseActivity {

    @Override
    public int getLayoutId() {
        return R.layout.activity_splash;
    }

    @Override
    public void setupView() {

    }

    @Override
    public void setupData() {
        delayTimer();
    }

    private void delayTimer() {
        Observable.timer(2500, TimeUnit.MILLISECONDS, AndroidSchedulers.mainThread()).subscribe(new Action1<Long>() {
            @Override
            public void call(Long aLong) {
                Intent intent = new Intent(SplashActivity.this, MainActivity.class);
                startActivity(intent);
                App.GetInstance().finishActivity(SplashActivity.this);
            }
        });
    }
}
